<?php
/**
 * Created by PhpStorm.
 * User: Dinglf
 * Date: 2016/9/19 0019
 * Time: 21:25
 */
$path = str_replace('\\','/',$_SERVER[DOCUMENT_ROOT]);
include $path.'/MsubStr.php';
$str = new MysubStr();
if(isset($_GET['id']))
{
    $id = $_GET['id'];
    $sql = new PDO('mysql:host=localhost;dbname=lyon','lyon','lyon123');
    $result = $sql->query("select title,content,time from lyon_text where id = '$id'");
    $row = $result->fetch();
    include "templates/single.html";
}
else
{
    echo "<script>alert('文章不存在.');history.go(-1);</script>";
}

?>